﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Escape
{
    class PitBlock: Block
    {

        Face f;

        public PitBlock(Vector3 position)
        {
            this.position = position;
            solidRender = true;
            alterRendering = true;
            collision = false;

            collisionDistanceX = -0.4f;
            collisionDistanceZ = -0.4f;

            loadTexture("Textures\\pit");

            f = new Face((int)position.X, (int)position.Z, Mode.floor);
        }

        public override void use()
        {
            if (isInBlock(GameScreen.c.CameraPosition))
                Player.die();
            base.use();
        }

        public override void alterRender()
        {
            GameScreen.effect.World = Matrix.CreateTranslation(0.0f, 0.0f, 0.0f);
            GameScreen.effect.Texture = tex;

            GameScreen.effect.CurrentTechnique.Passes[0].Apply();

            f.Render();
            base.alterRender();
        }

    }
}
